package org.example.handler;import io.netty.buffer.ByteBuf;import io.netty.buffer.Unpooled;import io.netty.channel.ChannelHandler;import io.netty.channel.ChannelHandlerContext;import io.netty.channel.SimpleChannelInboundHandler;import io.netty.util.CharsetUtil;@ChannelHandler.Sharablepublic class EchoClientHandler extends SimpleChannelInboundHandler<ByteBuf> {    public void channelActive(ChannelHandlerContext ctx) {        ctx.writeAndFlush(Unpooled.copiedBuffer("Netty Rocks!", CharsetUtil.UTF_8));    }    public void channelRead0(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf) throws Exception {        System.out.println("Client received：" + byteBuf.toString(CharsetUtil.UTF_8));    }    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {        cause.printStackTrace();        ctx.close();    }}